/*
 * @Author: 郝奔 1425466221@qq.com
 * @Date: 2024-11-29 10:20:27
 * @LastEditors: 郝奔 1425466221@qq.com
 * @LastEditTime: 2024-12-26 11:00:56
 * @FilePath: /HG-dqbasic_open_platform/src/framework/api/menu/types.ts
 * @Description: 
 * Copyright (c) 2024-present HBIS Digital Technology Co.,Ltd. All rights reserved. 
 */
import { RouteRecordRaw } from 'vue-router';
import { ID, ReqBasicInfo } from '@/framework/api/common/index';
export interface  servesListType{
  appTypeName:string;
  appList:appListType[]
}
export interface appListType extends DetailIdType ,FormDataType{
  title:string;
  appSource:number;
  openNewTag:number;
  menuPath:string;
  appAddress:string;
  appId:ID;
  formId:ID;
}

export interface LeftMenuType {
    active: string;
    children: LeftMenuType[];
    component: string;
    hide: boolean;
    icon: string;
    iconColor: string;
    iconType: string;
    menuCode: string;
    menuType: string;
    path: string;
    shortcut: boolean;
    title: string;
    visible: string;
    hidden: boolean;
    meta: AppRoutesDataMeta;
    name: string;
}
export interface LetMenuAll{
  buttonCodes:string[],
  menuRouterDTO:LeftMenuType[]
}
// /**
//  * 新增菜单类型声明
//  */
// export interface menuInfo {
//   menuName: string;
//   menuCode: string;
//   menuType: string;
//   appCode: string;
//   menuSort: number;
//   menuParentId: string | number;
//   menuParentName: string;
//   antdvIcon: string;
//   layuiVisible: string;
//   antdvRouter: string;
//   antdvComponent: string; //组件路径
//   antdvLinkOpenType: number,
//   menuId: string;
// }
// /**
//  * 菜单列表信息类型声明
//  */
// export interface menuListInfo extends ReqBasicInfo {
//   tenantId: string;
//   menuId: string;
//   menuParentId: string | number;
//   menuPids: string;
//   menuName: string;
//   menuCode: string;
//   appCode: string;
//   menuType: string;
//   menuSort: number;
//   statusFlag: number,
//   remark: string;
//   layuiPath: string;
//   layuiIcon: string;
//   layuiVisible: string;
//   antdvRouter: string;
//   antdvIcon: string;
//   antdvComponent: string;
//   antdvLinkOpenType: number,
//   antdvLinkUrl: string;
//   antdvActiveUrl: string;
//   antdvVisible: string;
//   shortcut: string;
//   pageName: string;
//   delFlag: string;
//   children: Array<menuListInfo>;
//   appName: string;
//   menuParentName: string;
//   leafFlag: boolean,
//   nodeId: string;
//   nodeParentId: string;
//   visible: string;
//   name: '',
//   iconColor: string;
//   iconType: number;
// }
// /**
//  * 菜单列表信息类型声明
//  */
// export interface menuButtonListParams extends ReqPage {
//   buttonCode: string
//   buttonId: string
//   buttonName: string
//   menuId: string
// }
// /**
//  * 菜单查询参数类型声明
//  */
// export interface ReqListParams extends ReqPage {
//   menuName: string;
//   menuCode: string;
//   menuType: string;
//   appCode: string;
//   menuSort: number;
//   menuParentId: string | number;
//   menuParentName: string;
//   antdvIcon: string;
//   layuiVisible: string;
//   antdvRouter: string;
//   antdvComponent: string; //组件路径
//   antdvLinkOpenType: number,
//   menuId: string;
// }

// /**
//  * 菜单查询参数类型声明
//  */
// export interface MenuQuery {
//   keywords?: string;
// }

// /**
//  * 菜单分页列表项声明
//  */

// export interface Menu {
//   id?: number;
//   parentId: number;
//   type?: string | 'CATEGORY' | 'MENU' | 'EXTLINK';
//   createTime: string;
//   updateTime: string;
//   name: string;
//   icon: string;
//   component: string;
//   sort: number;
//   visible: number;
//   children: Menu[];
// }

/**
 * 菜单表单类型声明
 */
export interface MenuForm {
  /**
   * 菜单ID
   */
  id?: string;
  /**
   * 父菜单ID
   */
  parentId: string;
  /**
   * 菜单名称
   */
  name: string;
  /**
   * 菜单是否可见(1:是;0:否;)
   */
  visible: number;
  icon?: string;
  /**
   * 排序
   */
  sort: number;
  /**
   * 组件路径
   */
  component?: string;
  /**
   * 路由路径
   */
  path: string;
  /**
   * 跳转路由路径
   */
  redirect?: string;

  /**
   * 菜单类型
   */
  type: string;

  /**
   * 权限标识
   */
  perm?: string;
  menuCode: string;
  menuType: string;
}

/**
 * 资源(菜单+权限)类型
 */
export interface Resource {
  /**
   * 菜单值
   */
  value: string;
  /**
   * 菜单文本
   */
  label: string;
  /**
   * 子菜单
   */
  children: Resource[];
}

/**
 * 权限类型
 */
export interface Permission {
  /**
   * 权限值
   */
  value: string;
  /**
   * 权限文本
   */
  label: string;
}

/**
 * 前端路由数据类型
 */
export interface AppRoutesData {
  /**
   * 路径
   */
  path: string;
  /**
   * 名称
   */
  name: string;
  /**
   * 是否隐藏
   */
  hidden: boolean;
  /**
 * icon
 */
  icon: string;
  /**
* 子路由
*/
  children: (RouteRecordRaw | AppRoutesData)[];
  /**
 * meta配置
 */
  meta: AppRoutesDataMeta;
  visible?: boolean | string;
  menuType?:string;
}
export interface ParentTitleType {
  meta: {
    title: string
  },
  path: string
}
export interface MenuListType extends FormDataType, DetailIdType, ReqBasicInfo {
  statusFlag: number;
  children?: MenuListType[];
  ref: string;
  props: {
    label: string;
    children: string;
  }
  data: MenuListType[];
  defaultExpandedKeys: string[];
  integratedMenuId: string;
}
export interface UpdateFlagType extends DetailIdType {
  statusFlag: number;
}

export interface MenuButtonFormDataType extends MenuButtonDetailIdType, DetailIdType {
  buttonName: string;
  buttonCode: string;
}
export interface MenuButtonDetailIdType {
  buttonId: ID;
}
export interface MenuButtonDetailIdsType {
  buttonIds: ID[]
}
export interface MenuButtonListType extends DetailIdType, MenuButtonFormDataType, MenuButtonDetailIdType, ReqBasicInfo {
  visible: boolean;
}

/**
 * 菜单树列表
 */
export interface RoleMenuListType {
  buttonCode: string;
  checked: boolean;
  children?: RoleMenuListType[];
  id: string;
  menuFlag: boolean;
  name: string;
  nodeId: string;
  nodeParentId: string;
  pid: string;
}
export interface MenuButtonType {
  buttonCode: string;
  buttonId: string;
}


export interface InterfaceListType extends InterfaceIDType, InterfaceDetailType, ReqBasicInfo {
  resourceName: string;
  url: string;
  httpMethod: string;
  resourceCode: string;
}
export interface InterfaceIDType {
  businessId: ID;
}
export interface InterfaceDetailType extends InterfaceIDType {
  selectedResource?: string[];
}
export interface AddMenuResourceBindType {
  businessType: string;
  businessId?: ID;
  selectedResource: string[];
}
export interface InterfaceAssociateType extends InterfaceIDType {
  resourceName: string;
  modularCode: string;
  modularName: string;
  resourceCode: string;
  isChecked: boolean;
}
export interface ResourceType {
  modularCode: string;
  modularName: string;
}
/**
 * 菜单列表信息类型声明
//  */
// export interface MenuButtonListType extends DetailIdType, ReqBasicInfo {
//   buttonCode: string
//   buttonId: string
//   buttonName: string
//   delFlag: string
//   tenantId: string
// }
export interface LeftMenuType {
  active: string;
  children: LeftMenuType[];
   // eslint-disable-next-line @typescript-eslint/no-explicit-any
  component: any;
  hide: boolean;
  icon: string;
  iconColor: string;
  iconType: string;
  menuCode: string;
  menuType: string;
  path: string;
  shortcut: boolean;
  title: string;
  visible: string;
  hidden: boolean;
  meta: AppRoutesDataMeta;
  name: string;
}
export interface LetMenuAll{
buttonCodes:string[],
menuRouterDTO:LeftMenuType[]
}
/**
* 菜单表单类型声明
*/
export interface MenuForm {
  /**
   * 菜单ID
   */
  id?: string;
  /**
   * 父菜单ID
   */
  parentId: string;
  /**
   * 菜单名称
   */
  name: string;
  /**
   * 菜单是否可见(1:是;0:否;)
   */
  visible: number;
  icon?: string;
  /**
   * 排序
   */
  sort: number;
  /**
   * 组件路径
   */
  component?: string;
  /**
   * 路由路径
   */
  path: string;
  /**
   * 跳转路由路径
   */
  redirect?: string;

  /**
   * 菜单类型
   */
  type: string;

  /**
   * 权限标识
   */
  perm?: string;
  menuCode: string;
  menuType: string;
}

/**
* 资源(菜单+权限)类型
*/
export interface Resource {
  /**
   * 菜单值
   */
  value: string;
  /**
   * 菜单文本
   */
  label: string;
  /**
   * 子菜单
   */
  children: Resource[];
}

/**
* 权限类型
*/
export interface Permission {
  /**
   * 权限值
   */
  value: string;
  /**
   * 权限文本
   */
  label: string;
}

/**
* 前端路由数据类型
*/
export interface AppRoutesData {
  /**
   * 路径
   */
  path: string;
  /**
   * 名称
   */
  name: string;
  /**
   * 是否隐藏
   */
  hidden: boolean;
  /**
 * icon
 */
  icon: string;
  /**
* 子路由
*/
  children: (RouteRecordRaw | AppRoutesData)[];
  /**
 * meta配置
 */
  meta: AppRoutesDataMeta;
  visible?: boolean | string;
  menuType?:string;
  props?:{
      id:string,
      url:string,
  }
}
/**
* meta
*/
export interface AppRoutesDataMeta {
  /**
   * 标题
   */
  title: string;
  icon: string;
  hidden?: boolean;
  parentTitle?: ParentTitleType;
  noCache?: boolean;
}
export interface FormDataType {
  resourceName: string;
  resourceCode: string;
  resourceType: string;
  appCode: string;
  resourceSort: string;
  resourceParentId: string | number;
  resourceParentName: string;
  resourcePids: string;
  antdvIcon: string;
  iconType: number;
  iconColor: string;
  layuiVisible: string;
  antdvRouter: string;
  antdvComponent: string; //组件路径
  antdvLinkOpenType: number,
  visible: string;
  antdvVisible: string;
  menuType: string;
  antdvlinkOpenType: string|number;
}
export interface DetailIdType {
  menuId: ID;
  resourceId: ID;
}

/**
* 菜单树列表
*/
export interface RoleMenuListType {
  buttonCode: string;
  checked: boolean;
  children?: RoleMenuListType[];
  id: string;
  menuFlag: boolean;
  name: string;
  nodeId: string;
  nodeParentId: string;
  pid: string;
}
export interface MenuButtonType {
  buttonCode: string;
  buttonId: string;
}

